//
//  MSUINavigationController+Additions.h
//  MusouKit
//
//  Created by danal on 13-4-8.
//  Copyright (c) 2013年 danal. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UINavigationController (Musou)
- (void)flipPopViewController;
- (void)flipPushViewController:(UIViewController *)vc;

@end


@interface NSBundle (Musou)
+ (NSString *)appVersion;

+ (NSString *)pathForRes:(NSString *)res;
+ (NSURL *)URLForRes:(NSString *)res;
+ (NSString *)pathForRes:(NSString *)res inBundle:(NSString *)bundle;
+ (NSURL *)URLForRes:(NSString *)res inBundle:(NSString *)bundle;

@end

@interface NSFileManager (Musou)
+ (void)clearDirectory:(NSString *)dirPath complete:(void(^)(void))block;
@end

@interface NSDate (Musou)

+ (NSString *)now;
+ (NSDate *)localDate;

@end


@interface NSDictionary (Musou)

- (NSNumber *)numberiForKey:(NSString *)key;
- (NSNumber *)numberfForKey:(NSString *)key;
- (NSString *)stringForKey:(NSString *)key;
- (NSArray *)arrayForKey:(NSString *)key;
- (NSDictionary *)dictForKey:(NSString *)key;
- (NSInteger)intForKey:(NSString *)key;
- (CGFloat)floatForKey:(NSString *)key;
- (BOOL)boolForKey:(NSString *)key;

@end

@interface NSMutableDictionary (Musou)
- (void)setFloat:(CGFloat)f forKey:(NSString *)key;
- (void)setInt:(NSInteger)i forKey:(NSString *)key;
@end


@interface NSObject (Musou)

- (void)invokeMethod:(SEL)selector target:(id)target;

+ (NSString *)documentsDirectory;
+ (NSString *)cachesDirectory;
+ (NSString *)pathInDocuments:(NSString *)file;
+ (NSString *)pathInCaches:(NSString *)file;

@end


@interface NSString (Musou)

- (id)objectForKey:(NSString *)key;

- (NSString *)md5;
- (NSString *)sha1;
- (NSString *)base64;

@end

@interface NSNull (Musou)
- (int)intValue;
- (float)floatValue;
- (int)longLongValue;
- (BOOL)boolValue;
@end


@interface NSNumber (Musou)

- (NSInteger)length;

+ (NSNumber *)numberi:(int)i;
+ (NSNumber *)numberf:(int)f;

@end


@interface UIView (Musou)

- (void)setOrigin:(CGPoint)point;
- (void)setSize:(CGSize)size;

+ (UIView *)loadFromNib;

@end